package com.example.demo.user.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表;
 * </p>
 *
 * @author 涛
 * @since 2024-08-01
 */
@Data
public class UUser implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * id
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    /**
     * 头像
     */
    @TableField("AVATAR")
    private String avatar;

    /**
     * 昵称
     */
    @TableField("NAME")
    private String name;

    /**
     * 自我介绍
     */
    @TableField("INTRODUCE")
    private String introduce;

    /**
     * 状态;正常、冻结、注销
     */
    @TableField("STATUS")
    private String status;

    /**
     * 性别
     */
    @TableField("SEX")
    private String sex;

    /**
     * 生日
     */
    @TableField("BIRTHDAY")
    private String birthday;

    /**
     * 常居地
     */
    @TableField("ADDRESS")
    private String address;

    /**
     * 手机号
     */
    @TableField("PHONE")
    private String phone;

    /**
     * 微信unionID
     */
    @TableField("WXUNIONID")
    private String wxunionid;

    /**
     * 微信openID
     */
    @TableField("WXOPENID")
    private String wxopenid;

    /**
     * 创建人
     */
    @TableField("CREATED_BY")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value="CREATED_TIME",fill = FieldFill.INSERT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATED_BY")
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value="UPDATED_TIME",fill = FieldFill.UPDATE)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime updatedTime;

    @Override
    public String toString() {
        return "UUser{" +
        "id=" + id +
        ", avatar=" + avatar +
        ", name=" + name +
        ", introduce=" + introduce +
        ", status=" + status +
        ", sex=" + sex +
        ", birthday=" + birthday +
        ", address=" + address +
        ", phone=" + phone +
        ", wxunionid=" + wxunionid +
        ", wxopenid=" + wxopenid +
        ", createdBy=" + createdBy +
        ", createdTime=" + createdTime +
        ", updatedBy=" + updatedBy +
        ", updatedTime=" + updatedTime +
        "}";
    }
}
